function write_kc_file( filename, kcm )
%write_kc_file Write kc data into file
%   Detailed explanation goes here
    row = size(kcm,1);
    col = size(kcm,2);
    fid = fopen(filename,'w');
    for i=1:row
        fprintf(fid, '%10d', int32(kcm(i,1)));
        for j=2:col
            fprintf(fid, ', %12.6e', kcm(i,j));
        end
        fprintf(fid, '\n');
    end
    fclose(fid);
end

